package com.example.dict.adapter;

import java.util.List;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class CollectFragmentAdapter extends FragmentPagerAdapter {
    List<Fragment> list;
    String[] titles;

    public CollectFragmentAdapter(FragmentManager fm,List<Fragment> list, String[] title) {
        super(fm);
        this.list = list;
        this.titles = title;
    }
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }
    @Override
    public int getCount() {
        return list.size();
    }
    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
